package com.example.common.domain;

import com.example.common.enums.ResultCode;

/**
 * @author gengaoliu
 */
public class CommonResponse<T> extends CrmResponse {

  public CommonResponse() {
    super(ResultCode.OK.getValue(), ResultCode.OK.getDesc());
  }

  public CommonResponse(String code, String msg) {
    super(code, msg);
  }

  public CommonResponse(ResultCode resultCode) {
    super(resultCode.getValue(), resultCode.getDesc());
  }

  private T data;

  public T getData() {
    return data;
  }

  public void setData(T data) {
    this.data = data;
  }

  public CommonResponse sucess(T t) {
    this.data = t;
    return this;
  }

  @Override
  public String toString() {
    return "CommonResponse{" + "resultCode" + super.getResultCode() + ",data=" + data + "}";
  }
}
